
//
//  YKVerticalButton.m
//  baisi
//
//  Created by 吴高烽 on 16/9/11.
//  Copyright © 2016年 吴高烽. All rights reserved.
//

#import "YKVerticalButton.h"

@implementation YKVerticalButton
-(void)awakeFromNib{
    [super awakeFromNib];
    [self setup];
}
-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self setup];
    }
    return self ;
}

-(void)setup{
    self.titleLabel.textAlignment = NSTextAlignmentCenter ;
}
-(void)layoutSubviews{
    [super layoutSubviews];
    self.imageView.x = 0 ;
    self.imageView.y = 0 ;
    self.imageView.width  = self.width;
    self.imageView.height = self.imageView.width;
    
    self.titleLabel.x = 0 ;
    self.titleLabel.y = self.imageView.height ;
    self.titleLabel.width = self.width ;
    self.titleLabel.height = self.height - self.imageView.height ;
}

@end
